﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Axis.Dao.Config;
using Axis.BusinessObject;
using Sotipha.Web.Views.Home;

namespace Sotipha.Web.Views.Towntalk
{
    public partial class Default :  CPage
    {
        public string LinkBanner = "#";
        protected void Page_Load(object sender, EventArgs e)
        {

            CConfigDao core = new CConfigDao();
            string inputValueConfig = string.Format("<InputValue ID=\"{0}\"/>", 3);
            IList<CConfigSite> listConfig = core.GetConfigSite(inputValueConfig);
            if (listConfig != null)
                if (listConfig.Count > 0)
                {
                    this.LinkBanner = listConfig[0].Link;
                    if (Session["lang"].ToString() == "vi")
                        ltrBanner.Text = string.Format("<img src=\"{0}\" class=\"BannerProduct\"/>", listConfig[0].Banner_VI);
                    else
                        ltrBanner.Text = string.Format("<img src=\"{0}\" class=\"BannerProduct\"/>", listConfig[0].Banner_EN);
                }
            int GroupID = -1;
            if (Request.QueryString["GroupID"] != null)
                GroupID = int.Parse(Request.QueryString["GroupID"].ToString());
            CProductUI UI = new CProductUI();
            ltrProductList.Text = UI.GetProductHTMLTowntalk(1, GroupID);
        }
    }
}